﻿using System;
using System.Collections.Generic;
using Gp.Scripts.Data.Skills;
using Gp.Scripts.Core;
using Gp.Scripts.Core.Unit;
using Sirenix.OdinInspector;
# if UNITY_EDITOR
using Sirenix.Utilities.Editor;
# endif
using UnityEngine;
using UnityEngine.Serialization;

namespace Gp.Scripts.Data {
    /// <summary>
    /// 记录单位身上的装备
    /// </summary>
    [Serializable, HideLabel]
    public class UnitEquip {
        [FormerlySerializedAs("skillData")] [LabelText("技能模块")]
        public List<MagicEntityConfig> equipMagic = new();
        [LabelText("单位技能")]
        public List<AbilitySkillEntityConfig> equipAbility = new();
        [LabelText("默认buff")]
        public List<BuffEntityConfig> buffData = new();

        // [LabelText("武器1")] [Space(10)] [SerializeField]
        // public WeaponEquip mainHand;
        //
        // [Space(10)] [LabelText("武器2")] [SerializeField]
        // public WeaponEquip offHand;

        [ListDrawerSettings(HideAddButton = true, HideRemoveButton =  true)]
        public ConfigWeapon[] weaponEquips = new ConfigWeapon[4];

        [Space(10)] [LabelText("护甲板"), OnValueChanged("ArmorCheck")]  [SerializeField]
        private ArmorEquip armor;

        

        public ArmorEquip ArmorEquip => armor;
        
        
        

#if UNITY_EDITOR
        private void ArmorCheck() {
            if (armor == null) return;
            SirenixEditorGUI.StartShakingGroup(this);
        }
#endif
    }
    
    
    
        
    
    [Serializable, HideLabel]
    public class ArmorInfo {
        [HideLabel]
        public ArmorEquip equip;
        [LabelText("是否损坏")]
        public bool isBroken;
    }

}